package com.book.entity;

import static com.github.drinkjava2.jsqlbox.JAVA8.*;
import static com.github.drinkjava2.jsqlbox.SQL.*;
import static com.github.drinkjava2.jsqlbox.DB.*;
import com.github.drinkjava2.jdbpro.SqlItem;
import com.github.drinkjava2.jdialects.annotation.jdia.*;
import com.github.drinkjava2.jdialects.annotation.jpa.*;
import com.github.drinkjava2.jsqlbox.*;

import lombok.ToString;

import java.util.Date;
import java.util.Map;



@ToString
@Table(name="book_chapter")
public class BookChapter extends ActiveRecord<BookChapter> {

	public static final String TABLE_NAME = "book_chapter";

	public static final String CHAPTER_ID章节ID = "chapter_id章节id";

	public static final String BOOK_ID = "book_id";

	public static final String CHAPTER_NAME = "chapter_name";

	public static final String CHAPTER_TEXT = "chapter_text";

	public static final String CREATE_TIME = "create_time";

	public static final String UPDATE_TIME = "update_time";



	@Id
	@Column(name="chapter_id")
	private Integer chapterId;
 


	@Column(name="book_id")
	@SingleFKey(name="FK_Reference_2", refs={"book_info","book_id"})
	private Integer bookId;
	
	
	private BookInfo bookInfo;

	@Column(name="chapter_name", length=200)
	private String chapterName;

	@Column(name="chapter_text")
	private String chapterText;

	@CreateTimestamp
	@Column(name="create_time")
	private Date createTime;

	@UpdateTimestamp
	@Column(name="update_time")
	private Date updateTime;



	public Integer getChapterId(){
		return chapterId;
	}

	public BookChapter setChapterId(Integer chapterId){
		this.chapterId=chapterId;
		return this;
	}

	public Integer getBookId(){
		return bookId;
	}

	public BookChapter setBookId(Integer bookId){
		this.bookId=bookId;
		return this;
	}

	public String getChapterName(){
		return chapterName;
	}

	public BookChapter setChapterName(String chapterName){
		this.chapterName=chapterName;
		return this;
	}

	public String getChapterText(){
		return chapterText;
	}

	public BookChapter setChapterText(String chapterText){
		this.chapterText=chapterText;
		return this;
	}

	public Date getCreateTime(){
		return createTime;
	}

	public BookChapter setCreateTime(Date createTime){
		this.createTime=createTime;
		return this;
	}

	public Date getUpdateTime(){
		return updateTime;
	}

	public BookChapter setUpdateTime(Date updateTime){
		this.updateTime=updateTime;
		return this;
	}

	public BookInfo getBookInfo() {
		return bookInfo;
	}

	public void setBookInfo(BookInfo bookInfo) {
		this.bookInfo = bookInfo;
	}
	

}
